﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SQLite;

namespace DbHelpe
{
    public class SqlLiteHelper : DbHelper
    {
        public SqlLiteHelper()
        {
            try
            {
                string dbFile = System.AppDomain.CurrentDomain.BaseDirectory + "CfgDB.db";
                //IniHelper ini = new IniHelper();
                //string dbFile = ini.ReadValue("CfgDb", "DataSource");
                SQLiteConnectionStringBuilder connSb = new SQLiteConnectionStringBuilder();
                connSb.DataSource = dbFile;
                connSb.Password = "gsafety";

                base.ProviderFactory = SQLiteFactory.Instance;
                base.ConnectionString = connSb.ToString();
            }
            catch (Exception ex)
            {
                Log.Error(ex.Message);
            }
        }
    }
}
